package com.blankii.androidlibrary.version

import com.blankii.androidlibrary.lib.version.VersionManager
import org.junit.Assert.assertEquals
import org.junit.Test

class VersionManagerTest {

    @Test
    fun compareVersions() {
        assertEquals(true, VersionManager.compareVersions("1.1.20", "1.1.21"))
        assertEquals(true, VersionManager.compareVersions("1.0.1", "1.1.1"))
        assertEquals(true, VersionManager.compareVersions("1.0.3", "1.1.1"))
        assertEquals(true, VersionManager.compareVersions("1.0.1", "1.0.2"))
        assertEquals(true, VersionManager.compareVersions("1.0", "1.0.1"))
        assertEquals(true, VersionManager.compareVersions("1.0.9", "1.0.10"))
        assertEquals(true, VersionManager.compareVersions("1.0.9", "1.1.10"))
        assertEquals(true, VersionManager.compareVersions("1.0.9", "2.1.10"))
        assertEquals(false, VersionManager.compareVersions("2.0.9", "1.1.10"))
        assertEquals(true, VersionManager.compareVersions("1", "1.0.10"))
        assertEquals(false, VersionManager.compareVersions("2", "1.0.10"))
        assertEquals(false, VersionManager.compareVersions("2", "1"))
        assertEquals(true, VersionManager.compareVersions("2", "2.1"))
    }
}